<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="radio" id="r1" name="gender" value="aa" >
<input type="radio" id="r2" name="gender" value="aa" >
<select id="nation">
    <option>请选择</option>
    <option value="1">汉</option>
    <option value="2">其它</option>
</select>
<input type="button" id="btn" value="点我">
<textarea id="txt" class="aaa"></textarea>
<script>
    var obj = document.getElementById('r1');

    var nationObj = document.getElementById('nation');
    //nationObj.options
    //nationObj.options[0]
    //nationObj.options[2].selected = true
    //nationObj.options.
    //nationObj.options.selectedIndex 选中的索引
    //nationObj.options[0]

    //<option value="1">汉</option>
    //nationObj.options[1].text 汉
    //nationObj.options[1].value 1

    var btn = document.getElementById('btn');

    btn.onclick = function (){
        var index = nationObj.options.selectedIndex;
        console.log(nationObj.options[nationObj.options.selectedIndex].text)
        console.log(nationObj.options[index].value)
    }

    var txt = document.getElementById('txt');
    //txt.value

    txt.className = 'bbb';//对应html class的属性， class className  <textarea id="txt" class="aaa"></textarea>

    //css 中的样式名
    // js  border-color  borderColor 当由多个字母组成是，去掉扛（-）后面的单词大写

</script>
</body>
</html>